<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <title>User Information</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }

    table {
      margin: auto;
      border-collapse: collapse;
      width: 100%;
      text-align: center;
    }
    th, td {
      border: 1px solid #ddd;
      padding: 8px;
      text-align: left;
    }

    th {
      background-color: #f2f2f2;
    }

    tr:nth-child(even) {
      background-color: #f9f9f9;
    }

    tr:hover {
      background-color: #f5f5f5;
    }

    .btn {
      padding: 6px 12px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      margin-bottom: 0;
      font-weight: normal;
      line-height: 1.42857143;
      white-space: nowrap;
      vertical-align: middle;
      cursor: pointer;
      border: 1px solid transparent;
      border-radius: 4px;
      color: #fff;
      background-color: #337ab7;
      border-color: #2e6da4;
      margin-left: 15px;
    }

    .btn:hover {
      background-color: #286090;
      border-color: #204d74;
    }
    a{
      text-decoration: none;
    }

    .btna {
      padding: 10px 20px;
      font-size: 16px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      border-radius: 4px;
      cursor: pointer;
      background-color: #4CAF50;
      color: white;
      border: none;
    }
    .btna:hover {
      background-color: #45a049;
    }
    .actions {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .actions a {
        margin: 0 5px;
        padding: 5px 10px;
        color: #fff;
        text-decoration: none;
        border-radius: 5px;
    }
  </style>
</head>
<body>
<h1>文件检测</h1>
<table>
  <tr>
    <th style="margin: auto">序号</th>
    <th>文件名称</th>
    <th>大小</th>
    <th>下载链接</th>
    <th>操作</th>
  </tr>
  <tr th:each="file ,status : ${fileList}">
    <td th:text="${status.index + 1}"></td>
    <td th:text="${file.name}">John Doe</td>
    <td th:text="${file.size}">johndoe@example.com</td>
    <td th:text="${file.downloadLink}">30</td>
   <!-- <td>
      <a th:href="@{'/lookFile'+${file.downloadLink}}" target="_blank" class="btn">查看</a>
      <a target="_blank" style="background-color: red" th:href="@{'/lookFile'+${file.downloadLink}+'&download'}" class="btn">下载</a>
    </td>-->
      <td class="actions">
          <a th:href="@{'' + ${'/upload'+file.downloadLink}}" target="_blank" class="btn">查看</a>
          <form th:action="@{/download}" method="get">
              <input type="hidden" name="downloadLink" th:value="${file.downloadLink}">
              <input type="submit" class="btn btn-primary"  value="下载"  style="background-color: #2ecc54">
          </form>
      </td>
  </tr>
</table>
</body>
</html>
